package com.rlz.framemm.algorithm

/**
 * Created by RLZ
 * on 2021/9/10
 *
 */
class Node(value: Int) {

    var mValue = value

    var mNext: Node? = null
}


class Test {

    fun swapPairs(head: Node?): Node {
        if (head ==null || head.mNext == null) return head!!

        val newHead = head.mNext!!
        val next = swapPairs(newHead.mNext)
        newHead.mNext = head
        head.mNext = next;
        print(newHead.mValue)
        return newHead
    }
}